package com.tzxs.pay.main.onlineaut.broadcast;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

import com.tzxs.pay.main.onlineaut.navigator.FinishNavigator;

import java.util.Objects;

//预授权结束后 清空数据的广播
public class AutFinishBroadCast extends BroadcastReceiver {
    private static final String TAG = AutFinishBroadCast.class.getSimpleName();
    public static final String ACTION_FINISH="com.tzxs.pay.main.onlineaut.broadcast.AutFinishBroadCast";
    @Override
    public void onReceive(Context context, Intent intent) {
        if (Objects.equals(intent.getAction(), ACTION_FINISH)) {
            //你覺得你的Fragment是Context 對象嗎?好像是
            //你這裡得到的context,是註冊了廣播的那個Context,可以是Application,Activity,Service,但是不能是Fragment
            FinishNavigator navigator = (FinishNavigator) context;
            navigator.clear();
        }

    }


}
